package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import coil.load
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jt.assistant.R
import com.jt.assistant.bean.HomeBean

class HomeAdapter(mData: MutableList<HomeBean>) :
    BaseQuickAdapter<HomeBean, BaseViewHolder>(
        R.layout.item_home, mData
    ) {

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: HomeBean) {
        val title = holder.getView<TextView>(R.id.tv_title)
        val pic = holder.getView<ImageView>(R.id.iv_pic) as ImageView
        title.text = item.title
        pic.load(item.pic)
    }
}
